// https://www.acwing.com/problem/content/794/

#include <iostream>
#include <vector>

using namespace std;

int comp(string& str1, string& str2) {
    if (str1.length() > str2.length()) {
        return 1;
    }
    if (str1.length() < str2.length()) {
        return -1;
    }
    for (int i=0; i<str1.length(); i++) {
        if (str1[i] > str2[i]) {
            return 1;
        }
        if (str1[i] < str2[i]) {
            return -1;
        }
    }

    return 0;
}

string sub(vector<int>& nums1, vector<int>& nums2) {
    for (int i=0; i<nums1.size(); i++) {
        nums1[i] -= nums2[i];
        if (nums1[i] < 0) {
            nums1[i] += 10;
            nums1[i+1]--;
        }
    }

    while (nums1.back() == 0) {
        nums1.pop_back();
    }

    string result;
    while (!nums1.empty()) {
        result += nums1.back() + '0';
        nums1.pop_back();
    }
    return result;
}


int main() {
    string str1, str2;
    cin>>str1>>str2;
    int max_length = max(str1.length(), str2.length());

    int p = comp(str1, str2);
    if (p == 0) {
        cout<<"0"<<endl;
        return 0;
    } else if (p < 0) {
        swap(str1, str2);
    }

    vector<int> nums1(max_length, 0);
    vector<int> nums2(max_length, 0);

    int t1=0;
    for (int i=str1.length()-1; i >= 0; i--) {
        nums1[t1++] = str1[i] - '0';
    }

    int t2=0;
    for (int i=str2.length()-1; i >= 0; i--) {
        nums2[t2++] = str2[i] - '0';
    }

    if (p < 0) {
        cout<<"-";
    }
    cout<<sub(nums1, nums2)<<endl;

    return 0;
}
